import sys

from news_classification.dependent_scripts import batch_download_dataset
from news_classification.dependent_scripts import batch_cut_jsonl_dataset
from news_classification.dependent_scripts import cpu_train_lda_model, gpu_train_lda_model
from news_classification.dependent_scripts import show_lda_model_topics
from news_classification.dependent_scripts import process_kuaixun_csv_dataset
from news_classification.dependent_scripts import cut_line_docs
from news_classification.dependent_scripts import build_dictionary
from news_classification.dependent_scripts import calculate_mapv

if __name__ == '__main__':
    if len(sys.argv) < 2:
        print('Please name a task!')
        exit(0)
    task = sys.argv[1]
    if task == 'download-news-dataset':
        batch_download_dataset.run()
    elif task == 'cut-news-dataset':
        batch_cut_jsonl_dataset.run()
    elif task == 'show-topics':
        show_lda_model_topics.run()
    elif task == 'cpu-train':
        cpu_train_lda_model.run()
    elif task == 'gpu-train':
        gpu_train_lda_model.run()
    elif task == 'process-kuaixun-csv-dataset':
        process_kuaixun_csv_dataset.run()
    elif task == 'cut-line-docs':
        cut_line_docs.run()
    elif task == 'build-dict':
        build_dictionary.run()
    elif task == 'mapv':
        calculate_mapv.run()
    else:
        print('Please name a correct task!')
